/*
*         (C) COPYRIGHT NBI Limited
*              ALL RIGHT RESERVED
*
* File        : fastflow/graph/function.h
* Authors     : dzhang
* Create Time : 2021/09/06 15:02:10
* Description :
*
*/

#ifndef __FASTFLOW_GRAPH_FUNCTION_H___
#define __FASTFLOW_GRAPH_FUNCTION_H___

#include "fastflow/core/common.h"
#include "fastflow/graph/indexed_sub_graph.h"
#include "fastflow/graph/onnx_proto_helper.h"

namespace fastflow {
class Graph;
class Node;
}  // namespace fastflow

namespace fastflow {

// Function representation class.
class Function {
 public:
  virtual ~Function() {}
  virtual const ONNX_NAMESPACE::OpSchema& OpSchema() const = 0;

  virtual const fastflow::Graph& Body() const = 0;

  virtual const IndexedSubGraph& GetIndexedSubGraph() const = 0;
};

std::unique_ptr<Function> MakeFunction(const fastflow::Graph& graph,
                                       std::unique_ptr<IndexedSubGraph> customized_func);
}  // namespace fastflow

#endif // __FASTFLOW_GRAPH_FUNCTION_H___